package code.jzh.compiler.scanner;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;

public class Reader {
	public static String readFile(String file) throws Exception {
        String filePath = Reader.class.getProtectionDomain().getCodeSource().getLocation().getPath()+"/"+file;
        InputStreamReader reader = new InputStreamReader(new FileInputStream(new File(filePath)));
        int tempchar;
        StringBuilder sb = new StringBuilder();
        while ((tempchar = reader.read()) != -1) {
        	sb.append((char)tempchar);
        }
        reader.close();
        return sb.toString();
	}
}
